{template 'header'}
<body>
<div class="x-body">
    <form class="layui-form">
        <div class="layui-form-item">
            <label for="tx_min" class="layui-form-label">
                <span class="x-red">*</span>最小提现金额
            </label>
            <div class="layui-input-inline">
                <input type="text" id="tx_min" name="tx_min" required="" lay-verify="tx_min"
                       autocomplete="off" value="{$setting['tx_min']}" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>最小1元
            </div>
        </div>
        <div class="layui-form-item">
            <label for="tx_fee" class="layui-form-label">
                <span class="x-red">*</span>提现手续费
            </label>
            <div class="layui-input-inline">
                <input type="text" id="tx_fee" name="tx_fee" required=""
                       lay-verify="tx_fee"
                       autocomplete="off" value="{$setting['tx_fee']}" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>百分值
            </div>
        </div>
        <!--<div class="layui-form-item">-->
            <!--<label for="share_task_profit" class="layui-form-label">-->
                <!--<span class="x-red"></span>分享任务奖金-->
            <!--</label>-->
            <!--<div class="layui-input-inline">-->
                <!--<input type="text" id="share_task_profit" name="share_task_profit" required=""-->
                       <!--lay-verify="share_task_profit"-->
                       <!--autocomplete="off" value="{$setting['share_task_profit']}" class="layui-input">-->
            <!--</div>-->
            <!--<div class="layui-form-mid layui-word-aux">-->
                <!--<span class="x-red"></span>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="layui-form-item">-->
            <!--<label for="task_receive_max" class="layui-form-label">-->
                <!--<span class="x-red"></span>单日任务接取上限-->
            <!--</label>-->
            <!--<div class="layui-input-inline">-->
                <!--<input type="text" id="task_receive_max" name="task_receive_max" required=""-->
                       <!--lay-verify="task_receive_max"-->
                       <!--autocomplete="off" value="{$setting['task_receive_max']}" class="layui-input">-->
            <!--</div>-->
            <!--<div class="layui-form-mid layui-word-aux">-->
                <!--<span class="x-red"></span>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="layui-form-item">-->
            <!--<label for="renqi_base" class="layui-form-label">-->
                <!--<span class="x-red"></span>任务人气基数-->
            <!--</label>-->
            <!--<div class="layui-input-inline">-->
                <!--<input type="text" id="renqi_base" name="renqi_base" required=""-->
                       <!--lay-verify="renqi_base"-->
                       <!--autocomplete="off" value="{$setting['renqi_base']}" class="layui-input">-->
            <!--</div>-->
            <!--<div class="layui-form-mid layui-word-aux">-->
                <!--<span class="x-red"></span>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="layui-form-item">-->
            <!--<label for="fabu_base" class="layui-form-label">-->
                <!--<span class="x-red"></span>任务发布基数-->
            <!--</label>-->
            <!--<div class="layui-input-inline">-->
                <!--<input type="text" id="fabu_base" name="fabu_base" required=""-->
                       <!--lay-verify="fabu_base"-->
                       <!--autocomplete="off" value="{$setting['fabu_base']}" class="layui-input">-->
            <!--</div>-->
            <!--<div class="layui-form-mid layui-word-aux">-->
                <!--<span class="x-red"></span>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="layui-form-item">-->
            <!--<label for="wancheng_base" class="layui-form-label">-->
                <!--<span class="x-red"></span>任务完成基数-->
            <!--</label>-->
            <!--<div class="layui-input-inline">-->
                <!--<input type="text" id="wancheng_base" name="wancheng_base" required=""-->
                       <!--lay-verify="wancheng_base"-->
                       <!--autocomplete="off" value="{$setting['wancheng_base']}" class="layui-input">-->
            <!--</div>-->
            <!--<div class="layui-form-mid layui-word-aux">-->
                <!--<span class="x-red"></span>-->
            <!--</div>-->
        <!--</div>-->
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button class="layui-btn" lay-filter="save" lay-submit="">
                保存
            </button>
        </div>
    </form>
</div>
<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;

        //自定义验证规则
        form.verify({
            tx_min: function (value) {
                if (value < 1) {
                    return '最少提现1元';
                }
            }, tx_fee: function (value) {
                if (value < 0) {
                    return '提现手续费不能小于0';
                }
            }, share_task_profit: function (value) {
                if (value < 0) {
                    return '任务奖金不能小于0';
                }
            },task_receive_max: function(value){
                if (value < 0) {
                    return '单日任务接取上限不能小于0';
                }
            }
        });

        //监听提交
        form.on('submit(save)', function (data) {
            console.log(data);
            var form_data = data.field
            //发异步，把数据提交给php
            var url = '{php echo $this->createWebUrl("setting",array("op"=>"task_param"))}'
            $.post(url, form_data, function (ret) {
                console.log(ret)
                if (ret.code) {
                    layer.msg(ret.msg, {icon: 1},function () {
                        location.reload()
                    });
                } else {
                    layer.msg(ret.msg, {icon: 0});
                }
            }, 'json')
            return false;
        });


    });
</script>
<script>var _hmt = _hmt || [];
(function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
</body>

</html>